﻿using System.Diagnostics;
using KuiHuaBaoDian.Services.Lockstep;

namespace Runtime.Services.Battle {

    /// <summary>
    /// 战斗玩家数据
    /// </summary>
    [DebuggerStepThrough]
    [DebuggerNonUserCode]
    public readonly struct DFR_BattlePlayerID {

        public static readonly DFR_BattlePlayerID None = new();

        /// <summary>
        /// 帧同步服务中的客户端ID
        /// </summary>
        public LockstepClientID ClientID { get; init; }

        public override bool Equals(object obj) {
            if (obj is DFR_BattlePlayerID other) {
                return other.ClientID == ClientID;
            }
            return false;
        }

        public override int GetHashCode() => ClientID.GetHashCode();

        public override string ToString() => $"[{nameof(DFR_BattlePlayerID)}({ClientID.GUID})]";

        public static bool operator ==(DFR_BattlePlayerID left, DFR_BattlePlayerID right) => left.Equals(right);
        public static bool operator !=(DFR_BattlePlayerID left, DFR_BattlePlayerID right) => !left.Equals(right);
    }
}
